/**
 * Copyright (c) 2022 Presto Labs Pte. Ltd.
 * Author: Ju
 */
#include "coin2/base/unpacker.h"

#include <cassert>
#include <cstring>
#include <stdexcept>

namespace coin2::base {

Unpacker::Unpacker(const void *buf, uint32_t len, bool init)
    : data_(RawBuffer{len, reinterpret_cast<const uint8_t *>(buf)}) {
  Reset();
  if (init) {
    Initialize();
  }
}

Unpacker::Unpacker(const char *buf, uint32_t len, bool init)
    : data_(RawBuffer{len, reinterpret_cast<const uint8_t *>(buf)}) {
  Reset();
  if (init) {
    Initialize();
  }
}

void Unpacker::Initialize() {
  uint32_t length = PopUint32();
  (void)length;
}

Unpacker::~Unpacker() {}
}  // namespace coin2::base
